<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets driver functionality to log</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongolog.setlevel.html">MongoLog::setLevel</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.mongopool.html">MongoPool</a></div>
 <div class="up"><a href="class.mongolog.html">MongoLog</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongolog.setmodule" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoLog::setModule</h1>
  <p class="verinfo">(PECL mongo &gt;= 1.2.3)</p><p class="refpurpose"><span class="refname">MongoLog::setModule</span> &mdash; <span class="dc-title">Sets driver functionality to log</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongolog.setmodule-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>MongoLog::setModule</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$module</code></span>
   )</div>

  <p class="para rdfs-comment">
   This function can be used to set which parts of the driver&#039;s functionality
   should be logged.  Use the constants described in the
   <a href="class.mongolog.html" class="classname">MongoLog</a> section with bitwise operators to specify
   modules.
  </p>
  <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;first,&nbsp;turning&nbsp;up&nbsp;the&nbsp;logging&nbsp;level<br /></span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">setLevel</span><span style="color: #007700">(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">ALL</span><span style="color: #007700">);<br /><br /><br /></span><span style="color: #FF8000">//&nbsp;log&nbsp;replica&nbsp;set&nbsp;activity<br /></span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">setModule</span><span style="color: #007700">(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">RS</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;log&nbsp;replica&nbsp;sets&nbsp;and&nbsp;connection&nbsp;pooling<br /></span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">setModule</span><span style="color: #007700">(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">RS</span><span style="color: #007700">|</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">ALL</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;log&nbsp;everything&nbsp;except&nbsp;IO&nbsp;activity<br /></span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">setModule</span><span style="color: #007700">(</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">ALL&nbsp;</span><span style="color: #007700">&amp;&nbsp;(~</span><span style="color: #0000BB">MongoLog</span><span style="color: #007700">::</span><span style="color: #0000BB">IO</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

  <p class="para">
   Note that you must also call <span class="function"><a href="mongolog.setlevel.html" class="function">MongoLog::setLevel()</a></span> to turn
   on logging.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongolog.setmodule-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">module</code></em>
     </dt>

     <dd>

      <p class="para">
       The module(s) you would like to log.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongolog.setlevel.html">MongoLog::setLevel</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.mongopool.html">MongoPool</a></div>
 <div class="up"><a href="class.mongolog.html">MongoLog</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
